/**
 * @author yinyuejia
 * @file 静态路由
 * @des
 */

const route = [
  {
    path: '/layout',
    name: 'layout',
    component: () => import('@/components/Layout/LayoutContainer.vue'),
    redirect: '/login',
    children: [],
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/login/index.vue'),
  },
  {
    path: '/:pathMatch(.*)*',
    name: '404',
    component: () => import('@/components/NotFound.vue'),
  },
];

export const businessRoute: any = [
  {
    path: '/',
    component: () => import('@/components/Layout/LayoutContainer.vue'),
    hidden: true,
    children: [
      {
        path: '/entityEdit',
        component: () => import('@/views/entity/edit.vue'),
        name: 'EntityEdit',
        meta: {
          title: 'entity.constantRouter_Edit',
        },
      },
      {
        path: '/entityAdd',
        component: () => import('@/views/entity/edit.vue'),
        name: 'EntityAdd',
        meta: {
          title: 'entity.constantRouter_Add',
        },
      },
      {
        path: '/entityManage',
        name: 'EntityManage',
        component: () => import('@/views/entity/manage.vue'),
        icon: 'link',
        meta: { title: 'entity.constantRouter_manage' },
      },
    ],
  },
  // {
  //   path: '/',
  //   component: () => import('@/components/Layout/LayoutContainer.vue'),
  //   hidden: true,
  //   children: [
  //     {
  //       path: '/entity/add',
  //       component: () => import('@/views/entity/edit.vue'),
  //       name: 'EntityAdd',
  //       meta: {
  //         title: 'entity.constantRouter_Add',
  //       },
  //     },
  //   ],
  // },
  // {
  //   path: '/entity',
  //   component: () => import('@/components/Layout/LayoutContainer.vue'),
  //   hidden: true,
  //   children: [
  //     {
  //       path: '/entity',
  //       name: 'Entity',
  //       icon: 'link',
  //       meta: { title: 'menu.legal' },
  //       children: [
  //         {
  //           path: '/entity/list',
  //           name: 'EntityList',
  //           component: () => import('@/views/entity/list.vue'),
  //           icon: 'link',
  //           meta: { title: 'entity.constantRouter_main' },
  //         },
  //         {
  //           path: '/entity/manage',
  //           name: 'EntityManage',
  //           component: () => import('@/views/entity/manage.vue'),
  //           icon: 'link',
  //           meta: { title: 'entity.constantRouter_manage' },
  //         },
  //       ],
  //     },
  //   ],
  // },
];

export default route;
// 主路由，后续会把layout组件赋值全局路由
export const mainRoute = route.filter((a) => a.name === 'layout')[0];
// 默认路由
export const defaultRoutes = [
  {
    path: '/home',
    name: 'Home',
    component: () => import('@/views/home/index.vue'),
    icon: 'HomeFilled',
    meta: { title: 'nav.home' },
  },
];
